home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Capture / AudioCap / AudioCap.cpp next >
Encoding:
C/C++ Source or Header  |  2001-10-10  |  2.5 KB  |  86 lines

  1. //------------------------------------------------------------------------------
  2. // File: AudioCap.cpp
  3. //
  4. // Desc: DirectShow sample code - Main program file for DirectShow 
  5. //       audio capture sample.
  6. //
  7. // Copyright (c) 2000-2001 Microsoft Corporation.  All rights reserved.
  8. //------------------------------------------------------------------------------
  9.  
  10. #include "stdafx.h"
  11. #include "AudioCap.h"
  12. #include "AudioCapDlg.h"
  13.  
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19.  
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CAudioCapApp
  22.  
  23. BEGIN_MESSAGE_MAP(CAudioCapApp, CWinApp)
  24.     //{{AFX_MSG_MAP(CAudioCapApp)
  25.         // NOTE - the ClassWizard will add and remove mapping macros here.
  26.         //    DO NOT EDIT what you see in these blocks of generated code!
  27.     //}}AFX_MSG
  28.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  29. END_MESSAGE_MAP()
  30.  
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CAudioCapApp construction
  33.  
  34. CAudioCapApp::CAudioCapApp()
  35. {
  36.     // TODO: add construction code here,
  37.     // Place all significant initialization in InitInstance
  38. }
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // The one and only CAudioCapApp object
  42.  
  43. CAudioCapApp theApp;
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CAudioCapApp initialization
  47.  
  48. BOOL CAudioCapApp::InitInstance()
  49. {
  50.     AfxEnableControlContainer();
  51.  
  52.     // Standard initialization
  53.     // If you are not using these features and wish to reduce the size
  54.     //  of your final executable, you should remove from the following
  55.     //  the specific initialization routines you do not need.
  56.  
  57. #ifdef _AFXDLL
  58.     // In MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete because
  59.     // their functionality is incorporated into Microsoft's 32-bit operating systems.
  60. #if (_MSC_VER <= 1200)
  61.     Enable3dControls();            // Call this when using MFC in a shared DLL
  62. #endif
  63. #else
  64.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  65. #endif
  66.  
  67.     CAudioCapDlg dlg;
  68.     m_pMainWnd = &dlg;
  69.     int nResponse = (int) dlg.DoModal();
  70.     
  71.     if (nResponse == IDOK)
  72.     {
  73.         // TODO: Place code here to handle when the dialog is
  74.         //  dismissed with OK
  75.     }
  76.     else if (nResponse == IDCANCEL)
  77.     {
  78.         // TODO: Place code here to handle when the dialog is
  79.         //  dismissed with Cancel
  80.     }
  81.  
  82.     // Since the dialog has been closed, return FALSE so that we exit the
  83.     //  application, rather than start the application's message pump.
  84.     return FALSE;
  85. }
  86.